Skip to content

Hole: an option to place several Single holes on one face by clicking (#12480) - #12481

Merged
bherbruck merged 1 commit into
tangency-labs:mainfrom
danieldimitrov86:fix-12480
Nov 7, 2026
Merged

bherbruck merged 1 commit into
tangency-labs:mainfrom
danieldimitrov86:fix-12480

Conversation

@danieldimitrov86

@danieldimitrov86 danieldimitrov86 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

A new option, Preferences › Tools › Hole › Several holes on one face, lets the Hole dialog's Single placement put several holes on one face by clicking: a pick elsewhere on the face adds a hole, and a pick on a hole takes that one out.

Fixes #12480

Problem

In Single placement a face takes one hole. A second pick on the same face takes the first hole out (or moves it, with "Move by click or drag"), so several holes on one face needed a sketch with points and Multiple placement, or one Hole dialog per hole.

Change

  • New preference hole_several (off by default), shown with the other Hole options on the Tools page, found by Preferences search, and settable over ui.prefs.
  • With it on, in a new Hole dialog with Single placement (crates/ui-egui/src/hole_place.rs):
    • a face pick that lands outside every hole on that face adds a hole there, even when "Move by click or drag" is on;
    • a pick inside a hole's circle takes that hole out, and only that one;
    • each hole keeps its own drag handle (hole:<n>);
    • a round face split at its seam is still picked whole, but each pick is one hole and the other half never becomes one.
  • OK makes one Hole feature per hole (dialogs.rs), as Single placement already does for holes on different faces.
  • Editing an existing Hole is unchanged and keeps its one place.
  • New UI strings are in assets/locales/pending/hole-several-per-face.json, with every complete catalog (ar, he, ja, vi, zh) and German.

Changes a default: no

A new preference, off by default; with it off, picks behave exactly as before.

Validation

  • New hole_place_ui_tests:
    • with_several_holes_on_a_face_a_pick_adds_one_and_a_pick_on_a_hole_takes_it_out: three picks on one face, remove the middle one, drag the second handle, OK; two Hole features, drilled where expected.
    • several_holes_on_a_round_face_are_one_per_pick: two picks on a cylinder's side make two holes.
    • snaps_and_moves_are_off_by_default_and_picks_behave_as_before now also checks the new option is off by default.
  • cargo test -p solidcraft-ui-egui --lib -- hole_place_ui_tests prefs i18n: 363 passed.
  • cargo clippy -p solidcraft-ui-egui --all-targets -D warnings, cargo fmt, cargo xtask lists and cargo xtask i18n --check are clean.
  • The full cargo xtask ci was not run locally (it runs out of memory on this machine).

Evidence

several-holes-one-face Release build: the option on the Tools page; five Single picks on one face give five hole previews ("5 selected"); clicking the middle hole takes it out; OK drills the other four, each its own Hole feature.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added an optional setting to place multiple Single holes on the same face. When enabled, selecting another spot adds a hole; selecting an existing hole removes it. Each hole can be adjusted individually.
    • Added translated labels and help text for the setting in seven languages.
  • Documentation
    • Documented the new setting and its default-off behavior.

Preferences > Tools > Hole > Several holes on one face (hole_several, off
by default). With it on, in Single placement a pick elsewhere on a face
that already has a hole adds another hole, and a pick on a hole takes that
one out; each hole keeps its own drag handle, and OK makes one Hole
feature per hole. A round face split at its seam still gives one hole per
pick. Off, a face takes one Single hole as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added area:infra CI, tooling, repo, docs area:ui desktop/web front end, dialogs, viewport labels Nov 6, 2026
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Adds a default-off Tools preference for placing several Single holes on one face. When enabled, picking elsewhere on a face adds a hole, and picking within an existing hole removes it. Each hole has an individual handle.

Changes: Multi-hole placement

Layer / File(s) Summary
Preference and settings
crates/ui-egui/src/prefs.rs, crates/ui-egui/src/prefs/tools.rs, assets/locales/pending/hole-several-per-face.json, docs/control-protocol.md, docs/design/preferences/pages/tools.md, crates/ui-egui/src/hole_place_ui_tests.rs, crates/ui-egui/src/prefs_search.rs
Adds the default-off hole_several preference to Tools settings. Adds localized labels and help text, preference documentation, and checks for preference defaults and search.
Multi-hole picking
crates/ui-egui/src/hole_place.rs, crates/ui-egui/src/viewport.rs, crates/ui-egui/src/dialogs.rs
For eligible Single-hole dialogs, picks add a hole at a new location or remove a hole when picked within its radius. The viewport routes picks to this handler, and dialog processing uses the selected positions.
Per-hole handles and placement tests
crates/ui-egui/src/hole_place.rs, crates/ui-egui/src/hole_place_ui_tests.rs
Handles use the multi-hole list when the preference applies, allowing individual holes to move or be removed. Tests cover adding, removing, and moving holes, accepting and drilling the remaining holes, and picks on a seam-split cylindrical face.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Viewport
  participant Picker as pick_several
  participant Dialog
  User->>Viewport: Pick a face location
  Viewport->>Picker: Handle the picked item
  Picker->>Dialog: Add or remove a hole position
  Dialog->>Dialog: Process selected hole positions
Loading

Possibly related issues

  • tangency-labs/solidcraft#6818 — The PR adds an individual handle for each hole, which relates to the issue’s shared placement-handle proposal.
  • tangency-labs/solidcraft#2171 — The PR adds opt-in placement of multiple holes by clicking on one face.

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: nathan-dane

Merge Risk: Minimal · up to 9de6d

No concrete placement regression is established. The PR-description check still needs its requested wording before the checks pass.

Security architecture risk: Low · up to 9de6d

The feature is opt-in and uses the existing design-editing workflow. The reviewed paths retain eligibility checks and guarded document adoption, with no identified increase in privileges or security exposure. Assurance is limited for some placement edge cases.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected path affects pending placements and, after acceptance, geometry in the active design. It increases placement cardinality without introducing a different privileged command sink or document owner.

Trust Boundaries and Controls

  • observed — The changed placement methods are crate-visible UI dispatch, while Tools show is parent-module-visible. Face mutation requires an eligible dialog and active face input; viewport picks and handle changes are blocked during application. The new preference uses the existing staged preference-control path.

Resilience and Maintainability Implications

  • observed — The existing application boundary computes the command sequence in scratch state before adoption. Engine acceptance checks source currency; computation failures return before adoption, cancellation discards pending results, and repeat application clears placement inputs. These controls contain partial computation and stale document writes for the new caller.
Pre-merge checks: Passed 5 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 5 passed

Check name Status Explanation
Title check Passed The title clearly describes the new option for placing several Single holes on one face.
Linked Issues check Passed [ #12480 ] hole_several is off by default and appears beside the Hole preferences. In new Single placement, picks outside existing holes add a hole, and picks inside a hole remove it. Tests cover th…
Out of Scope Changes check Passed [ #12480 ] The placement and dialog changes implement the requested behavior. The preference, search, translations, documentation, and tests support that behavior.
Existing Defaults Unchanged Passed The new hole_several preference defaults to false, including for saved preferences that lack the field. With it off, the existing pick and command paths remain unchanged. The new preference control …
Description check Passed The description covers the change, default behavior, validation, and visual evidence. It omits integration status and explicit expected and measured geometry values.
Full details: Linked Issues check

Explanation

[ #12480 ] hole_several is off by default and appears beside the Hole preferences. In new Single placement, picks outside existing holes add a hole, and picks inside a hole remove it. Tests cover those actions, individual handles, confirmation, round faces, and the default setting.

Full details: Existing Defaults Unchanged

Explanation

The new hole_several preference defaults to false, including for saved preferences that lack the field. With it off, the existing pick and command paths remain unchanged. The new preference control is additive.

Full details: Docstring Coverage

Explanation

Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 11 functions across 5 files. (5 skipped: 3 unsupported, 2 too large.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8505c77 and 9de6dd0.

Files selected for processing: 10

  • assets/locales/pending/hole-several-per-face.json
  • crates/ui-egui/src/dialogs.rs
  • crates/ui-egui/src/hole_place.rs
  • crates/ui-egui/src/hole_place_ui_tests.rs
  • crates/ui-egui/src/prefs.rs
  • crates/ui-egui/src/prefs/tools.rs
  • crates/ui-egui/src/prefs_search.rs
  • crates/ui-egui/src/viewport.rs
  • docs/control-protocol.md
  • docs/design/preferences/pages/tools.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@theironchef theironchef left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked merged onto main together with #12389 (Windows, MSVC, --profile ci): the hole_place, dialogs_hole and prefs::tests tests pass (390 in that filter, along with #12389's), clippy is clean, and cargo xtask lists is clean.

several is limited to a new Hole in Single placement (d.editing.is_none(), !opts.multiple), so editing an existing hole keeps its one place, and the default-off preference leaves today's behaviour alone. Picking a seam-split round face once yields one hole through grouped_selection (the other half never becomes one), which is the subtle case, and it's tested. This fits with #12493 (grouping the holes one OK makes): several holes on one face are exactly what that folder groups. Looks good to me.

@bherbruck bherbruck added approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) ready to merge reviewed, every ask addressed; merge once CI is green and removed approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) labels Nov 7, 2026
@bherbruck
bherbruck added this pull request to the merge queue Nov 7, 2026
Merged via the queue into tangency-labs:main with commit 0debd97 Nov 7, 2026
120 of 135 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) area:infra CI, tooling, repo, docs area:ui desktop/web front end, dialogs, viewport ready to merge reviewed, every ask addressed; merge once CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hole: place several Single holes on one face by clicking

3 participants